import request from '@/config/axios'

export interface ManufacturerVO {
  id: number
  code: string
  manufacturerName: string
  location: string
  manufacturerNotes: string
}

// 查询生产厂商分页
export const getManufacturerPage = async (params) => {
  return await request.get({ url: `/eam/manufacturer/page`, params })
}

// 查询生产厂商详情
export const getManufacturer = async (id: number) => {
  return await request.get({ url: `/eam/manufacturer/get?id=` + id })
}

// 新增生产厂商
export const createManufacturer = async (data: ManufacturerVO) => {
  return await request.post({ url: `/eam/manufacturer/create`, data })
}

// 修改生产厂商
export const updateManufacturer = async (data: ManufacturerVO) => {
  return await request.put({ url: `/eam/manufacturer/update`, data })
}

// 删除生产厂商
export const deleteManufacturer = async (id: number) => {
  return await request.delete({ url: `/eam/manufacturer/delete?id=` + id })
}

// 导出生产厂商 Excel
export const exportManufacturer = async (params) => {
  return await request.download({ url: `/eam/manufacturer/export-excel`, params })
}